package com.ebelter.myehc.ui.activitys;



import android.support.v4.app.Fragment;

import com.ebelter.myehc.R;
import com.ebelter.myehc.ui.fragments.about.About_Fragment;
import com.ebelter.myehc.ui.fragments.modifys.ModifyAddInfo_Fragment;
import com.ebelter.myehc.ui.fragments.modifys.ModifyBirthday_Fragment;
import com.ebelter.myehc.ui.fragments.modifys.ModifyHeight_Fragment;
import com.ebelter.myehc.ui.fragments.modifys.ModifySex_Fragment;
import com.ebelter.myehc.ui.fragments.modifys.ModifyShHSet_Fragment;
import com.ebelter.myehc.ui.fragments.modifys.ModifyWeight_Fragment;

public class ModifyInfoActivity extends EhcBaseActivity {

    public static final String TAG = "ModifyInfoActivity";
    public static final String KEY = "ModifyInfoActivitya_KEY";
    public static final int MODIFY_SEX = 1;//修改性别
    public static final int MODIFY_SHH_TIME_SET = 2;//手环时间设置
    public static final int MODIFY_BIRTHDAY = 3;//生日
    public static final int MODIFY_ADDINFO = 4;//添加信息
    public static final int MODIFY_Height = 5;
    public static final int MODIFY_Weight = 7;
    public static final int About = 6;


    public int currentModifyType;



    @Override
    protected int loadLayoutById() {
        return R.layout.activity_modify_info;
    }


    @Override
    protected void initView() {
        super.initView();
        currentModifyType = getIntent().getIntExtra(KEY,-1);
        if (currentModifyType==-1){
            throw new RuntimeException("参数不对异常");
        }
        replaceFragment(getFragmentByModifyType(currentModifyType),R.id.modify_root_fl);

    }


    public Fragment getFragmentByModifyType(int currentModifyType){
        Fragment fragment = null;
        if (currentModifyType==MODIFY_SEX){
            fragment=new ModifySex_Fragment();//修改性别
        }else if (currentModifyType==MODIFY_SHH_TIME_SET){
            fragment=new ModifyShHSet_Fragment();//手环设置
        }else if (currentModifyType==MODIFY_BIRTHDAY){
            fragment=new ModifyBirthday_Fragment();//修改生日
        }else if (currentModifyType==MODIFY_ADDINFO){
            fragment=new ModifyAddInfo_Fragment();//添加信息
        }else if (currentModifyType==MODIFY_Height){
            fragment=new ModifyHeight_Fragment();//修改身高
        }else if (currentModifyType==About){
            fragment=new About_Fragment();//关于
        }else if (currentModifyType==MODIFY_Weight){
            fragment=new ModifyWeight_Fragment();//修改体重
        }
        return fragment;
    }

    @Override
    protected void initData() {
        super.initData();
    }
}
